package org.jmpo;

public class EnumMethod {
    public static int daysInMonth(Month m) {
        return switch(m) {
            case Month.Jan -> 31;
            case Month.Feb -> 28;
            case Month.Mar -> 31;
            case Month.Apr -> 30;
            case Month.May -> 31;
            case Month.Jun -> 30;
            case Month.Jul -> 31;
            case Month.Aug -> 31;
            case Month.Sep -> 30;
            case Month.Oct -> 31;
            case Month.Nov -> 30;
            case Month.Dec -> 31;
        };
    }
 
    public static enum Month {
        Jan,
        Feb,
        Mar,
        Apr,
        May,
        Jun,
        Jul,
        Aug,
        Sep,
        Oct,
        Nov,
        Dec
    }
}
